// 测试数据库查询
import { Essay } from './src/models/index.js';

const essayId = '77466c90-7439-491d-8b8e-f224ac8d23ec';

async function testQuery() {
  try {
    console.log('\n=== 查询Essay ===');
    console.log('ID:', essayId);
    
    const essay = await Essay.findByPk(essayId);
    
    if (essay) {
      console.log('\n✅ Essay存在！');
      console.log('状态:', essay.status);
      console.log('分数:', essay.score);
      console.log('有批改结果:', !!essay.correctionResult);
      console.log('批改结果keys:', essay.correctionResult ? Object.keys(essay.correctionResult) : 'null');
      console.log('\n完整数据:');
      console.log(JSON.stringify(essay.toJSON(), null, 2));
    } else {
      console.log('\n❌ Essay不存在');
    }
    
    process.exit(0);
  } catch (error) {
    console.error('\n❌ 查询失败:', error.message);
    process.exit(1);
  }
}

testQuery();

